import React from "react";
import {render} from "react-dom";


window.React = React;

class If extends React.Component {
  render() {
    return this.props.condition ? React.Children.only(this.props.children) : null ;
  }
}

class WWW extends React.Component {
  render() {
      return (
        <div className="joke">
           <If condition={false}>
             <p className="p1"> hello world #1 </p>
           </If>
           <If condition={true}>
             <p className="p2"> hello world #2 </p>
           </If>
           <PP />
        </div>
      )
  }
}

class PP extends React.Component {
  render() {
      return (
        <p className="yy"> Good For You!! </p>
      )
  }
}


window.component = render(<WWW />, document.getElementById('app'));
